class Event{
#listeners={
  /*'bark':[fn1,fn2],
   *'hello':[fn3,fn4]
   * */
}

on(evt,fn){
  if(typeof (this.#listeners[evt])==='undefined'){
    this.#listeners[evt]=[];
  }
  this.#listeners[evt].push(fn);
}
emit(evt,arg){
  const fns=this.#listeners[evt];
  for(const fn of fns){
    fn();
  }
}
}
module.exports=Event;
